<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: TypedArrayHelper</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: TypedArrayHelper</h1>

    




<section>

<header>
    
        <h2>
            <span class="ancestors"><a href="SPE.html">SPE</a>.</span>
        
        TypedArrayHelper
        </h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    <h4 class="name" id="TypedArrayHelper"><span class="type-signature"></span>new TypedArrayHelper<span class="signature">(TypedArrayConstructor, size, componentSize, indexOffset)</span><span class="type-signature"></span></h4>

    



<div class="description">
    A helper class for TypedArrays.

Allows for easy resizing, assignment of various component-based
types (Vector2s, Vector3s, Vector4s, Mat3s, Mat4s),
as well as Colors (where components are `r`, `g`, `b`),
Numbers, and setting from other TypedArrays.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>TypedArrayConstructor</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">The constructor to use (Float32Array, Uint8Array, etc.)</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>size</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The size of the array to create</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>componentSize</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The number of components per-value (ie. 3 for a vec3, 9 for a Mat3, etc.)</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>indexOffset</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index in the array from which to start assigning values. Default `0` if none provided</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    
    <dt class="tag-author">Author:</dt>
    <dd class="tag-author">
        <ul>
            <li>Luke Moody</li>
        </ul>
    </dd>
    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line16">line 16</a>
    </li></ul></dd>
    

    

    

    
</dl>
















    
    </div>

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="getComponentValueAtIndex"><span class="type-signature"></span>getComponentValueAtIndex<span class="signature">(index)</span><span class="type-signature"> &rarr; {TypedArray}</span></h4>

    



<div class="description">
    Returns the component value of the array at the given index, taking into account
the `indexOffset` property of this class.

If the componentSize is set to 3, then it will return a new TypedArray
of length 3.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index in the array to fetch.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line327">line 327</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The component value at the given index.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">TypedArray</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="getValueAtIndex"><span class="type-signature"></span>getValueAtIndex<span class="signature">(index)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    Returns the value of the array at the given index, taking into account
the `indexOffset` property of this class.

Note that this function ignores the component size and will just return a
single value.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index in the array to fetch.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line311">line 311</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The value at the given index.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="grow"><span class="type-signature"></span>grow<span class="signature">(size)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Grows the internal array.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>size</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The new size of the typed array. Must be larger than `this.array.length`.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line77">line 77</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setColor"><span class="type-signature"></span>setColor<span class="signature">(index, color)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Color value at `index`.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec3 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>color</code></td>
            

            <td class="type">
            
                
<span class="param-type">Color</span>


            
            </td>

            

            

            <td class="description last">Any object that has `r`, `g`, and `b` properties.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line281">line 281</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setFromArray"><span class="type-signature"></span>setFromArray<span class="signature">(index, array)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Copies from the given TypedArray into this one, using the index argument
as the start position. Alias for `TypedArray.set`. Will automatically resize
if the given source array is of a larger size than the internal array.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The start position from which to copy into this array.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>array</code></td>
            

            <td class="type">
            
                
<span class="param-type">TypedArray</span>


            
            </td>

            

            

            <td class="description last">The array from which to copy; the source array.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line128">line 128</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setMat3"><span class="type-signature"></span>setMat3<span class="signature">(index, mat3)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Matrix3 value at `index`.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the matrix values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>mat3</code></td>
            

            <td class="type">
            
                
<span class="param-type">Matrix3</span>


            
            </td>

            

            

            <td class="description last">The 3x3 matrix to set from. Must have a TypedArray property named `elements` to copy from.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line255">line 255</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setMat4"><span class="type-signature"></span>setMat4<span class="signature">(index, mat3)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Matrix4 value at `index`.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the matrix values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>mat3</code></td>
            

            <td class="type">
            
                
<span class="param-type">Matrix4</span>


            
            </td>

            

            

            <td class="description last">The 4x4 matrix to set from. Must have a TypedArray property named `elements` to copy from.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line268">line 268</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setNumber"><span class="type-signature"></span>setNumber<span class="signature">(index, numericValue)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Number value at `index`.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec3 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>numericValue</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The number to assign to this index in the array.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line294">line 294</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setSize"><span class="type-signature"></span>setSize<span class="signature">(size)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Sets the size of the internal array.

Delegates to `this.shrink` or `this.grow` depending on size
argument's relation to the current size of the internal array.

Note that if the array is to be shrunk, data will be lost.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>size</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The new size of the array.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line38">line 38</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="setVec2"><span class="type-signature"></span>setVec2<span class="signature">(index, vec2)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Vector2 value at `index`.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec2 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>vec2</code></td>
            

            <td class="type">
            
                
<span class="param-type">Vector2</span>


            
            </td>

            

            

            <td class="description last">Any object that has `x` and `y` properties.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line153">line 153</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setVec2Components"><span class="type-signature"></span>setVec2Components<span class="signature">(index, x, y)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Vector2 value using raw components.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec2 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec2's `x` component.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec2's `y` component.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line167">line 167</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setVec3"><span class="type-signature"></span>setVec3<span class="signature">(index, vec2)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Vector3 value at `index`.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec3 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>vec2</code></td>
            

            <td class="type">
            
                
<span class="param-type">Vector3</span>


            
            </td>

            

            

            <td class="description last">Any object that has `x`, `y`, and `z` properties.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line185">line 185</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setVec3Components"><span class="type-signature"></span>setVec3Components<span class="signature">(index, x, y, z)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Vector3 value using raw components.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec3 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec3's `x` component.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec3's `y` component.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>z</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec3's `z` component.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line200">line 200</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setVec4"><span class="type-signature"></span>setVec4<span class="signature">(index, vec2)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Vector4 value at `index`.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec4 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>vec2</code></td>
            

            <td class="type">
            
                
<span class="param-type">Vector4</span>


            
            </td>

            

            

            <td class="description last">Any object that has `x`, `y`, `z`, and `w` properties.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line219">line 219</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="setVec4Components"><span class="type-signature"></span>setVec4Components<span class="signature">(index, x, y, z, w)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Set a Vector4 value using raw components.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The index at which to set the vec4 values from.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec4's `x` component.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec4's `y` component.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>z</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec4's `z` component.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>w</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The Vec4's `w` component.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line235">line 235</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="shrink"><span class="type-signature"></span>shrink<span class="signature">(size)</span><span class="type-signature"> &rarr; {<a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a>}</span></h4>

    



<div class="description">
    Shrinks the internal array.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>size</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The new size of the typed array. Must be smaller than `this.array.length`.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line64">line 64</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Instance of this class.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="SPE.TypedArrayHelper.html">SPE.TypedArrayHelper</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="splice"><span class="type-signature"></span>splice<span class="signature">(start, end)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    



<div class="description">
    Perform a splice operation on this array's buffer.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>start</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The start index of the splice. Will be multiplied by the number of components for this attribute.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>end</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last">The end index of the splice. Will be multiplied by the number of components for this attribute.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="helpers_SPE.TypedArrayHelper.js.html">helpers/SPE.TypedArrayHelper.js</a>, <a href="helpers_SPE.TypedArrayHelper.js.html#line97">line 97</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The SPE.TypedArrayHelper instance.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    



        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="SPE.Emitter.html">Emitter</a></li><li><a href="SPE.Group.html">Group</a></li><li><a href="SPE.ShaderAttribute.html">ShaderAttribute</a></li><li><a href="SPE.TypedArrayHelper.html">TypedArrayHelper</a></li></ul><h3>Namespaces</h3><ul><li><a href="SPE.html">SPE</a></li><li><a href="SPE.utils.html">utils</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Sat Nov 14 2015 15:30:50 GMT+0000 (GMT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>